#include <iostream>
#include <vector>
#include <algorithm>
using namespace std;
int main()
{
    int v1[200005];
    int n, m, temp, count = 0;
    cin >> n;
    for (int i = 1; i <= n; i++)
        scanf("%d",&v1[i]);
    v1[n + 1] = 0x7fffffff;
    scanf("%d",&m);
    int midpos = (n + m + 1) / 2, i = 1;
    for (int j = 1; j <= m; j++)
    {
        scanf("%d",&temp);
        while (v1[i] < temp)
        {
            count++;
            if (count == midpos)
                cout << v1[i];
            i++;
        }
        count++;
        if (count == midpos)
            cout << temp;
    }
    while (i <= n)
    {
        count++;
        if (count == midpos)
            cout << v1[i];
        i++;
    }
    return 0;
}